Skip to content

fix(scripts): hash dynamic import() reach in turbo typecheck inputs - #10144

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
RealDiligent:fix/scripts-turbo-dynamic-import-10046
Jul 31, 2026
Merged

fix(scripts): hash dynamic import() reach in turbo typecheck inputs#10144
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
RealDiligent:fix/scripts-turbo-dynamic-import-10046

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

Summary

  • Widen collectCrossBoundaryReach so dynamic import() (including multi-line) is detected like static from / bare import.
  • Add packages/loopover-miner/package.json to //#typecheck inputs so the widened reach stays hashed.
  • Regression test covering dynamic + static forms on a synthetic tree.

Closes #10046

Test plan

  • npm run turbo-inputs:check exits 0
  • Real tree reach includes packages/loopover-miner/package.json

@RealDiligent
RealDiligent requested a review from JSONbored as a code owner July 31, 2026 09:03
@loopover-orb

loopover-orb Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-31 09:38:50 UTC

3 files · 1 AI reviewer · no blockers · readiness 86/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR widens the cross-boundary-import regex in check-turbo-typecheck-inputs.ts to also match dynamic import() calls (including multi-line, whitespace-tolerant forms), adds the newly-discovered packages/loopover-miner/package.json to turbo.json's //#typecheck inputs, and adds a synthetic-tree regression test plus keeps the existing INVARIANT test (which re-validates against the real repo tree and passed in CI) covering the fix. The regex change (`\s*\(?\s*` between the from/import keyword and the opening quote) correctly still matches static `from "..."` and bare `import "..."` forms while now also matching `import("...")` and its multi-line variant, and matches are still filtered by `existsSync` so stray comment/fixture text can't cause false positives. This is a narrowly-scoped, well-tested bug fix directly closing the linked issue #10046, with the turbo.json input list and the checker script kept in sync.

Nits — 3 non-blocking
  • The updated regex comment is dense; a one-line example of the dynamic multi-line form next to the code (scripts/check-turbo-typecheck-inputs.ts:81-83) would help future readers faster than prose alone.
  • The new regression test (test/unit/check-turbo-typecheck-inputs.test.ts:58-92) builds a full synthetic tmpdir tree — consider whether a narrower unit test directly against the regex/parsing logic would be faster and less filesystem-dependent, though the existing test suite already favors this synthetic-tree style so it's consistent.
  • Consider adding a small comment noting why `\(?` is intentionally optional-and-generic rather than anchored specifically to `import(` (to avoid a future reader wondering if `from(` matching was intended) — minor, since the existsSync filter makes it harmless either way.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #10046
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ❌ 8/20 High review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 244 registered-repo PR(s), 95 merged, 38 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RealDiligent; Gittensor profile; 244 PR(s), 38 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The regex is widened to accept optional parens/whitespace (matching the sibling checker's pattern) so dynamic import() including the multi-line miner-cli.test.ts form is now captured, turbo.json gains the loopover-miner package.json input, and a regression test pins both the dynamic and static cases while preserving the on-disk-existence and packages/apps segment filters.

Review context
  • Author: RealDiligent
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, Ruby, TypeScript, Svelte, Cuda, JavaScript, Markdown, MDX
  • Official Gittensor activity: 244 PR(s), 38 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Add a concise scope and risk note.
  • Then work through the remaining 1 step in the Signals table above.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

Widen collectCrossBoundaryReach to match dynamic import like the dead-source
checker, and hash packages/loopover-miner/package.json on //#typecheck.

Closes JSONbored#10046

Co-authored-by: Cursor <cursoragent@cursor.com>
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 31, 2026
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.99%. Comparing base (291fcd9) to head (c48a432).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10144   +/-   ##
=======================================
  Coverage   91.99%   91.99%           
=======================================
  Files         931      931           
  Lines      114000   114000           
  Branches    27523    27523           
=======================================
  Hits       104877   104877           
  Misses       7823     7823           
  Partials     1300     1300           
Flag Coverage Δ
backend 95.67% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 453e7af into JSONbored:main Jul 31, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scripts(checks): check-turbo-typecheck-inputs misses dynamic import(...), leaving packages/loopover-miner/package.json unhashed

2 participants